package com.Ling.Thread.sync;



/**
 * File Name: ThreadCreate
 * Date: 2020-06-24 15:15
 * Author: liangling
 * Description
 */
public class ThreadCreate {
    public static void main(String[] args) {

      Runnable r = () ->{
          for(int i=0;i<10;i++){
              System.out.println("线程2中的逻辑"+i);
          }
      };
      Thread thread = new Thread(r);
      thread.start();
    }
}




//线程实例化
//1，继承Thread类，做一个线程子类
//        MyThread myThread = new MyThread();
//        //start方法开启新线程，线程进入就绪状态
//        // 直接调用run不会开辟新线程
//        myThread.start();


//class MyThread extends Thread{
//    @Override
//    public void run() {
//        for(int i=0;i<10;i++){
//            System.out.println("子线程中的逻辑"+i);
//        }
//    }
//}